package me.shiqiang.im.server;

import com.corundumstudio.socketio.SocketIOServer;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author cuishiqiang
 * @date 2017/12/12 下午1:21
 */
@Component
public class Server implements DisposableBean {

    @Autowired
    SocketIOServer socketIOServer;

    @Override
    public void destroy() throws Exception {
        socketIOServer.stop();
    }

    public void start() throws Exception {
        socketIOServer.start();
    }
}
